<%@ page language="java" import="java.util.*,cn.nsu.douban.entity.*"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html>
<htmL>
<head>
<s:debug></s:debug>
    <title>豆瓣电影</title>
  <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.raty.js"></script>
  <script type="text/javascript">
  $(function(){
    $(".wen-biao-right").click(function(){
          $("[name='pageNum']").val($("[name='pageNum']").val()*1+1);
     $("form:first").submit();  
    });
    $(".wen-biao-left").click(function(){
    $("[name='pageNum']").val($("[name='pageNum']").val()-1);
     $("form:first").submit();  
    });
  });  
  </script>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css">
</head>
<body>
<form action="${pageContext.request.contextPath}/movie_showisHotMovie" method="post">
<div id="db-global-nav" class="global-nav">
<s:hidden  name="pageNum" />
     <div class="bd">
        <div class="top-nav-right" style="position: relative;">
              <s:if test="nowUser==null">
            <a href="" class="oon">登录</a>
            <a href="" class="oon">注册</a>
            </s:if>
        <s:else>
      <span id="showExit" >${nowUser['loginname'] }</span>      
      <a href="${pageContext.request.contextPath}/user_exit" id="exit"  style="">退出</a>
        </s:else>
            <a href="" class="oon">下载豆瓣客户端</a>
        </div>
    </div>

    <div class="top-nav-left">
        <ul class="">
            <li class="on">
                <a href="">豆瓣</a>
            </li>
            <li class="on">
                <a href="">读书</a>
            </li>
            <li class="on">
                <a href="">电影</a>
            </li>
            <li class="on">
                <a href="">音乐</a>
            </li>
            <li class="on">
                <a href="">同城</a>
            </li>
            <li class="on">
                <a href="">小组</a>
            </li>
            <li class="on">
                <a href="">阅读</a>
            </li>
            <li class="on">
                <a href="">FM</a>
            </li>
            <li class="on">
                <a href="">东西</a>
            </li>
            <li class="on">
                <a href="">市集</a>
            </li>
            <li class="on">
                <a href=""><span>更多</span></a>
            </li>
        </ul>
    </div>
</div>

</form>
<div id="db-nav-movie" class="nav">
    <div class="nav-wrap">
        <div class="nav-primary">
            <div class="nav-logo">
                <a href="">豆瓣电影</a>
            </div>
            <div class="nav-search">    
                    <fieldset>
                        <legend>搜索：</legend>
                        <label for="inp-query">
                        </label>
                        <div class="inp"><input id="inp-query" name="search_text" size="22" maxlength="60"
                                                placeholder="电影、影人、影院、电视剧" value=""></div>
                        <div class="inp-btn"><input type="button" value="搜索" id="searchs"></div>
                        <input type="hidden" name="cat" value="1002"/>
                    </fieldset>
            </div>
        </div>
    </div>

    
   
   <div class="nav-secondary">
        <div class="nav-items">
            <ul>
                <li><a href="">影讯&购票</a>
                </li>
                <li><a href="">选电影</a>
                </li>
                <li><a href="">电视剧</a>
                </li>
                <li><a href="">排行榜</a>
                </li>
                <li><a href="">分类</a>
                </li>
                <li><a href="">影评</a>
                </li>
                <li><a href="">2016年度榜单</a>
                </li>
                <li><a href="">2016观影报告</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="nav">
    <div class="nav-primary">
        <div class="wen-primary wen-bottom">
            <div class="wen-re">
                <span class="h2">
                    <strong>正在热映</strong>
                    <a class="wen-h2" href="">全部正在热映»</a>
                    <a class="wen-h2" href="">即将上映»</a>
                </span>
            </div>
            <div class="wen-biao">
                <span><a class="wen-biao-left" href="javascript:void(0)"></a></span>

                <span><a class="wen-biao-right" href="javascript:void(0)"></a></span>
            </div>
            <div id="wen-shu" class="wen-biao">
                <!--替换-->
                <span class="wen-shu-index">${pageNum}</span>
                /
                <!--替换-->
                <span class="wen-shu-max">${totalPage }</span>
                &nbsp;
            </div>
        </div>
    </div>
 <script type="text/javascript">
     $(function(){
     var pageNum=${pageNum};
     var totalPage=${totalPage};
     if(totalPage==1){
     $(".wen-biao-right").hide();
     }
     else if(pageNum==1){
     $(".wen-biao-left").hide();
     $(".wen-biao-right").show();
     }else if(totalPage==pageNum){
        $(".wen-biao-right").hide();
     }else if(pageNum==1){
        $(".wen-biao-left").hide();
          $(".wen-biao-right").show();
     }else {
         $(".wen-biao-left").show();
          $(".wen-biao-right").show();
     }
     
     });
 
 </script>
    <div class="nav-primary">
        <!--遍历-->
    <div class="wen-primary" id="qingk" style="width: 700px">

                <s:iterator value="%{mList}">
        <ul class="dianying dianying-duiqi" id="nowDiany" style="width: 150px">
            <li class="dianying-tu">
            <!-- 详情 -->  
                <a class="" href="${pageContext.request.contextPath}/movie_showMovieDetail.action?mid=${id}">
                    <img src="${imagpath}"   rel="nofollow">
                </a>
            </li>
            <li class="dianying-name">${name }</li>
            <li class="dianying-pin">
         
                <div class="start" data-number="${score }"></div>
                <span class="dianying-pin-wen1">评分:&nbsp;&nbsp;&nbsp;${score}</span>
       
            </li>
            <li class="dianying-xuan">
                    <span>
                        <a href="" class="dianying-xuan-bth">
                            选座购票
                        </a>
                    </span>
              </li>
        </ul>
             <!-- 动态 显示评分 -->
                     <script type="text/javascript">
                     $(function(){
               $('.start').raty({
               path:"${pageContext.request.contextPath}/style/img",
                width:"160px",
            score: function() {
              return $(this).attr('data-number')
                 },
              });
          });
              </script>
            </s:iterator>     
            
            
           <script type="text/javascript">
    $("#searchs").click(function(){
     var value=$("#inp-query").val();
     var url=encodeURI("${pageContext.request.contextPath}/movie_serarchMovie?search_text="+value);
       url=encodeURI(url);
      $.get(url,{},function(date){
      $("#qingk").empty();
      var movieArr=date.movieList;
        for(var i=0;i<movieArr.length;i++){
                  var $ul=$('<ul class="dianying dianying-duiqi" id="nowDiany"></ul>');
                     var $li=$(' <li class="dianying-tu"></li>');
                          var $li2=$('<li class="dianying-tu"></li>');
                   var $a=$('<a class="" href="${pageContext.request.contextPath}/movie_showMovieDetail.action?mid='+movieArr[i].id+'"></a>');
                  var $imag=$('<img src="'+movieArr[i].imagpath+'"   rel="nofollow"/>');              
                  var $liname=$(' <li class="dianying-name">'+movieArr[i].name+'</li>');
                  $a.append($imag);
                $li.append($a);
                $ul.append($li);
                /*
                      <li class="dianying-xuan">
                    <span>
                        <a href="" class="dianying-xuan-bth">
                            选座购票
                        </a>
                    </span>
              </li>
                */
                var $lixuan=$('<li class="dianying-xuan"></li>');
                var  $lispan=$('  <span></span>');
                var $lixuana=$('<a href="" class="dianying-xuan-bth">选坐购票</a>')
                         $lispan.append($lixuana);
                $lixuan.append($lispan);
                $ul.append($liname);
                $ul.append($lixuan);
               $("#qingk").append($ul);
        }
      });   
    
    });
    </script>
        <!--  -->
    <div style="clear: both;width: 0;height: 0"></div>
    </div>
        <div class="">
            <a href="">
                <img class="dianying-left-guanggao"  src="${pageContext.request.contextPath}/img/gg.jpg">
            </a>
        </div>
        <div class="gaia">
            <h2>
                选电影  / 
                <a class="gaia-fer">选电视剧</a>
            </h2>
        </div>
        <div class="mode-shang">
            <div class="xian"></div>
        </div>
        <div>
            <div class="ree">
                <div class="ree-renme">
                    <span><a href="${pageContext.request.contextPath}/movie_showisHotMovie.action">热门</a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a hre><span>最新</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>经典</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>可播放</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>豆瓣高分</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>冷门佳片</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>华语</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>欧美</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>韩国</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>日本</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>动作</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>喜剧</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>爱情</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>科幻</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>悬疑</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>恐怖</span></a></span>
                </div>
                <div class="div-fei">
                    <span class="ree-fei"><a><span>成长</span></a></span>
                </div>
            </div>
        
            <div class="box">
                <div class="box-left">
                    <input type="radio" name="tag" checked id="dm1"><label>按热度排序</label>
                    <input type="radio" name="tag" value="time" id="time"><label>按时间排序</label>
                    <input type="radio" name="tag" value="pj"><label>按评价排序</label>
                   </div>
                  <div class="box-right">
                    <input type="checkbox" name="tad"><label>我没看过的</label>
                    <input type="checkbox" name="tad"><label>可在线播放</label>
                </div>
            </div>


        </div>
           <div class="dianyingjihe"  > 
          <s:iterator value="mList">
        
            <div class="dianyingjihe-he" id="ajaxTime">
                <a >
                    <div>
                        <img src="${imagpath}">
                    </div>
                    <p class="dianyingjihe-pwem">${name }<strong class="dianyingjihe-wen">${pingfen }</strong></p>
                </a>
            </div>
          
          </s:iterator>
            </div>
                <script type="text/javascript">
            $("#time").change(function(){
            $.post("${pageContext.request.contextPath}/movie_timeQuery",{},function(date){
            var mInfoList= date.movieList;
             $("#ajaxTime").remove(); 
              for(var i=0;i<mInfoList.length;i++){
                var  $divjihe=$('<div class="dianyingjihe-he" id="ajaxTime"></div>');
/*                var  $a=$('<a href="${pageContext.request.contextPath}/movie_showMovieDetail.action?mid='+mInfoList[i].id+'"></a>');
 */                   var $a=$('<a class="" href="${pageContext.request.contextPath}/movie_showMovieDetail.action?mid='+mInfoList[i].id+'"></a>');
               var $div=$('<div></div>');
               var $img=$('<img src="'+mInfoList[i].imagpath+'">');
               var  $p=$(' <p class="dianyingjihe-pwem">${name }<strong class="dianyingjihe-wen">'+mInfoList[i].score+'</strong></p>');         
            $a.append($div);
            $div.append($img);
            $divjihe.append($a);
            $divjihe.append($p);
               }
             });
          });
</script>
        <a href="" class="more left-width">加载更多</a>
        <div class="clear"></div>
        <div class="nav-primary">
            <div class="wen-primary wen-bottom held">
                <div class="wen-re">
                <span class="h2">
                    <strong>热门推荐</strong>
                </span>
                </div>
                <div class="wen-biao">
                    <span><a class="wen-biao-left" href=""></a></span>

                    <span><a class="wen-biao-right" href=""></a></span>
                </div>
                <div id="wen-shu" class="wen-biao">
                    <!--替换-->
                    <span class="wen-shu-index">${pageNum+1 }</span>
                    /
                    <!--替换-->
                    <span class="wen-shu-max">${totalPage }</span>
                    &nbsp;
                </div>
            </div>
        </div>
        <div>
 
</body>
</html>